-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] TEZ-4505: Create counters about time intervals spent in certain states in StateMachineTez #304
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
…s in StateMachineTez
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds cool to me, I think you need to add some test around it as well
@@ -34,6 +38,10 @@ public class StateMachineTez<STATE extends Enum<STATE>, EVENTTYPE extends Enum<E | |||
|
|||
private final StateMachine<STATE, EVENTTYPE, EVENT> realStatemachine; | |||
|
|||
private boolean isStateIntervalMonitorEnabled = false; | |||
private long lastStateChangedTime = Time.monotonicNow(); | |||
private Map<String, Long> intervalSpentInStatesMs = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be final
@@ -34,6 +38,10 @@ public class StateMachineTez<STATE extends Enum<STATE>, EVENTTYPE extends Enum<E | |||
|
|||
private final StateMachine<STATE, EVENTTYPE, EVENT> realStatemachine; | |||
|
|||
private boolean isStateIntervalMonitorEnabled = false; | |||
private long lastStateChangedTime = Time.monotonicNow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be set as part of enableStateIntervalMonitor
?
@@ -484,6 +493,18 @@ public TezCounters getCounters() { | |||
} | |||
} | |||
|
|||
private void maybeMergeAllTaskAttemptCounters(TezCounters taskCounters) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
I think we can ditch maybe from the name & just have mergeAllTaskAttemptCounters(
, if stateIntervalMontior is enabled it does merge always
*/ | ||
package org.apache.tez.common.counters; | ||
|
||
public class TaskAttemptCounter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't decode the usage of this 'empty' class, we are only using the name of this class, if only name is required can't we have a string constant or an enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a leftover, actually I'm in the middle of this, full of bugs, let me set this PR to [DRAFT]
No description provided.